{load header}
<!--/H-->

    <!-- 内容区 -->
    <div id="main-content">
        <div id="top-alert" class="fixed alert alert-error" style="display: none;">
            <button class="close fixed" style="margin-top: 4px;">&times;</button>
            <div class="alert-content">这是内容</div>
        </div>
        <div id="main" class="main">
        <!-- nav --><!-- nav -->
            
	<div class="main-title">
		<h2>{$item['name_ch']}-图片资料</h2>
	</div>
        
  <div class="tab-wrap">
                <ul class="tab-nav nav">
                    <li {if $tt == "credit"}class="current"{/if}><a href="{eval echo site_url('interests/tupianziliao')}?key={$item['name_en']}">平台证件资料</a></li>
                    <li {if $tt == "office"}class="current"{/if}><a href="{eval echo site_url('interests/tupianziliao')}?key={$item['name_en']}&type=office">办公环境资料</a></li>
		</ul>
     <div class="tab-content">       
	<div class="cf">
            {if $tt == "credit"}
            <a class="btn" href="{eval echo site_url('interests/tupianziliao_add')}?key={$item['name_en']}&type=credit">新增平台证件</a>
            {else}
            <a class="btn" href="{eval echo site_url('interests/tupianziliao_add')}?key={$item['name_en']}&type=office">新增办公环境</a>
            {/if}
	</div>
	
	<div class="data-table table-striped">
		<table>
			<thead>
                            <tr>
                                <th>排序</th>
                                <th>图片标题</th>
                                <th>图片预览</th>
                                <th>是否显示</th>
                                <th>操作</th>
                            </tr>
			</thead>
			<tbody>
                            <!--{loop $list $val}-->
                            <tr>
                                <td>
                                    <form action="{eval echo site_url('interests/tupianziliao_setsort')}" method="post">
                                        <input type="hidden" name="id" value="{$val['id']}">
                                        <input type="hidden" name="type" value="{$tt}">
                                        <input type="hidden" name="key" value="{$val['plat_en']}">
                                        <input type="text" name="sort" class="text" value="{$val['sort']}" style="width:50px;">
                                    </form>
                                </td>
                                <td>{$val['title']}</td>
                                <td><!--{if ($val['image_url']!='')}--><img height="50" src="{$val['image_url']}"><!--{/if}--></td>
                                <td>
                                    <a title="<!--{if ($val['is_show'])=='0' }-->设为显示<!--{else}-->点击隐藏<!--{/if}-->" href="{eval echo site_url('interests/tupianziliao_setshow').'?id='.$val['id'].'&is_show='.abs(1-$val['is_show']).'&key='.$val['plat_en']}&type={$val['type']}" class="ajax-get"><!--{if ($val['is_show'])=='0' }--><span style="color:#ff0000">隐藏</span><!--{else}-->显示<!--{/if}--></a>
                                </td>
                                <td>
                                    <a title="编辑" href="{eval echo site_url('interests/tupianziliao_edit').'?id='.$val['id']}&key={$val['plat_en']}&type={$tt}">编辑</a>&nbsp;|
                                    <a title="删除" href="{eval echo site_url('interests/tupianziliao_setdel').'?id='.$val['id'].'&key='.$val['plat_en']}&type={$tt}">删除</a>
                                </td>
                            </tr>
                            <!--{/loop}-->
			</tbody>
		</table>
		<!-- 分页 -->
	    <div class="page">
	        <div>
			{$showpage}
			<span class="rows">共 {$Total} 条记录</span>
			</div>
		</div>
		
	</div>
         </div>   
        </div>
<script>
    $(function(){
	//搜索功能
	$("#search").click(function(){
            
	var url = $(this).attr('url');
        var query  = $('.search-form').find('input').serialize();
        query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
        query = query.replace(/^&/g,'');

        if( url.indexOf('?')>0 ){
            url += '&' + query;
        }else{
            url += '?' + query;
        }
		window.location.href = url;
	});
	
        	
    //回车自动提交
    $('.search-form').find('input').keyup(function(event){
        if(event.keyCode===13){
            $("#search").click();
        }
    });


    /* 实时更新分类信息 */
    $(".tab-content")
            .on("submit", "form", function(){
                    var self = $(this);
                    $.post(
                            self.attr("action"),
                            self.serialize(),
                            "json"
                    );
                    return false;
            })
            .on("focus","input",function(){
                    $(this).data('param',$(this).closest("form").serialize());

                })
            .on("blur", "input", function(){
                    if($(this).data('param')!=$(this).closest("form").serialize()){
                        $(this).closest("form").submit();
                    }
                });
})
</script>
<!--F-->{load footer}